package com.groupbuying.storeinternal.service.forManage;

import com.groupbuying.storeinternal.domain.forManage.StoreMenuDO;
import com.groupbuying.storeinternal.domain.forManage.Tree;
import com.groupbuying.storeinternal.dto.RouterDTO;
import org.springframework.stereotype.Service;

import java.math.BigInteger;
import java.util.List;
import java.util.Map;
import java.util.Set;

/**
 * 菜单管理
 * 
 * @author yuwenxiaodong
 * @email yuwenxiaodong@126.com
 * @date 2019-03-22 11:55:05
 */
@Service
public interface StoreMenuService {
	Tree<StoreMenuDO> getSysMenuTree(String id);

	/**
	 * 登录用户的权限
	 * @author ywxd
	 * @param userId
	 * @return
	 */
	List<StoreMenuDO> userMenus(String userId);

	List<Tree<StoreMenuDO>> listMenuTree(String id);

	List<RouterDTO> RouterDTOsByUserId(String userId);

	Tree<StoreMenuDO> getTree();

	Tree<StoreMenuDO> getTree(String id);

	//@CacheEvict(value = "permission",key = "#userId")
	//boolean clearCache(String userId);

	List<StoreMenuDO> list(Map<String, Object> params);

	int remove(String id);

	int save(StoreMenuDO menu);

	int update(StoreMenuDO menu);

	StoreMenuDO get(String id);

	Set<String> listPerms(String userId);

	/**
	 * 获取角色下的权限所有id
	 * @param roleId
	 * @return
	 */
	List<BigInteger> MenuIdsByRoleId(String roleId);



	/**
	 * 用户权限
	 */
	List<String> PermsByUserId(String userId);
}
